export default class NativeUtils{

    public static native = globalThis.electronAPI;

    /**废弃 */
    public static saveJson22(info:any):void
    {
        if (NativeUtils.native == null) {
            return;
        }
        NativeUtils.native.saveJson(info);
    }

    public static async saveJson(info:any)
    {
        if (NativeUtils.native == null) {
            return;
        }
        console.log("开始保存数据",info);
        let result:boolean = await NativeUtils.native.saveJson(info);
        if (result) {
            console.log("保存配置成功！！");
        }else{
            console.log("保存配置失败！！");
        }
    }

    public static async openFile()
    {
        if (NativeUtils.native == null) {
            return;
        }
        console.log("开始选取文件");
        let filePath:string = await NativeUtils.native.openFile();
        console.log("获取到的文件路径为:", filePath);
    }


    public static async getConfig()
    {
        if (NativeUtils.native == null) {
            return;
        }
        console.log("开始选取文件");
        let result:any = await NativeUtils.native.getConfig();
        console.log("获取到的数据为:", result);


    }


    




   
}
